package com.example.crmdemo.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.crmdemo.project.domain.Customer;
import com.example.crmdemo.project.mapper.CustomerMapper;
import com.example.crmdemo.project.service.ICustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 客户对象实现类
 *
 * @author 赵炜
 * @date 2021-01-18
 */
@Service
public class ICustomerServiceImp extends ServiceImpl<CustomerMapper, Customer> implements ICustomerService {

    @Override
    public List<Customer> findAllCustomer() {
        QueryWrapper<Customer> queryWrapper = new QueryWrapper<Customer>();
        queryWrapper.select("customerid","customer_name").orderByDesc("customerid");
        return this.list(queryWrapper);
    }
}
